package com.gdepri.mqtt.subscriber;


import com.github.tocrhz.mqtt.annotation.MqttSubscribe;
import com.github.tocrhz.mqtt.annotation.NamedValue;
import com.github.tocrhz.mqtt.annotation.Payload;
import org.springframework.stereotype.Component;

//@Component
public class SubscribeSampleV1 {

    {
        System.out.println("SubscribeSampleV1已经被注入");
    }

    @MqttSubscribe("/v1/devices/{gatewayId}/topo/test")
    public void topoAdd(@NamedValue("gatewayId") String gatewayId, @Payload String payload,String topic){
        System.out.println("----------------------------------------");
        System.out.println("gateway:"+gatewayId);
        System.out.println("payload有效载荷:"+payload);
        System.out.println("topic:"+topic);
    }
}
